From e510059a8bfc564407ed044639e607c8f5ab0d6f Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 4 Jan 2017 14:28:02 +0100 Subject: [PATCH] x86emul: make _PRE_EFLAGS() tolerate first argument being 32-bit While this may appear to introduce a truncation issue, the high 32 bits get zapped already anyway (early in _PRE_EFLAGS() as well as in _POST_EFLAGS()). Once a subsequent patch switches to use proper 32-bit EFLAGS operands, we'll in fact end up with more correct code, as that zeroing of the upper halves will then go away. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- xen/arch/x86/x86_emulate/x86_emulate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index 29e1f46550..e200e61c53 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -530,7 +530,8 @@ typedef union { "pop %"_tmp"; " \ "orl %"_LO32 _tmp",("_STK"); " \ "popf; " \ -"pop %"_sav"; " +"pop %"_tmp"; " \ +"movl %"_LO32 _tmp",%"_LO32 _sav"; " /* After executing instruction: write-back necessary bits in EFLAGS. */ #define _POST_EFLAGS(_sav, _msk, _tmp) \ -- 2.30.2